<!doctype html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/mytestblog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/mytestblog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/mytestblog/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="matlab,horizons,ephemeris," />








  <link rel="shortcut icon" type="image/x-icon" href="/mytestblog/favicon.ico?v=5.1.0" />






<meta name="description" content="一个小的开源项目 callHorizonMatlab通过matlab在线调用JPL的horizons历表，是根据 callhorizons python版本演变过来的，但是做了一些简化。主要提供了三个方法，可以分别获取历表，轨道根数，三维向量。
基本用法下载 queryHorizons.m 与queryTest.m 并加入matlab的路径。运行测试方法1runtests(&apos;queryTest&apos;)">
<meta property="og:type" content="article">
<meta property="og:title" content="开源项目callHorizonMatlab">
<meta property="og:url" content="http://vancky.oschina.io/mytestblog/2017/02/15/开源项目callHorizonMatlab/index.html">
<meta property="og:site_name" content="vancky's Blog">
<meta property="og:description" content="一个小的开源项目 callHorizonMatlab通过matlab在线调用JPL的horizons历表，是根据 callhorizons python版本演变过来的，但是做了一些简化。主要提供了三个方法，可以分别获取历表，轨道根数，三维向量。
基本用法下载 queryHorizons.m 与queryTest.m 并加入matlab的路径。运行测试方法1runtests(&apos;queryTest&apos;)">
<meta property="og:updated_time" content="2017-02-15T14:26:36.989Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="开源项目callHorizonMatlab">
<meta name="twitter:description" content="一个小的开源项目 callHorizonMatlab通过matlab在线调用JPL的horizons历表，是根据 callhorizons python版本演变过来的，但是做了一些简化。主要提供了三个方法，可以分别获取历表，轨道根数，三维向量。
基本用法下载 queryHorizons.m 与queryTest.m 并加入matlab的路径。运行测试方法1runtests(&apos;queryTest&apos;)">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/mytestblog/',
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://vancky.oschina.io/mytestblog/2017/02/15/开源项目callHorizonMatlab/"/>





  <title> 开源项目callHorizonMatlab | vancky's Blog </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  














  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta custom-logo">
  

  <div class="custom-logo-site-title">
    <a href="/mytestblog/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">vancky's Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
    
      <p class="site-subtitle">astrometry ,mathematicas and computer sciences</p>
    
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/mytestblog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/mytestblog/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/mytestblog/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://vancky.oschina.io/mytestblog/mytestblog/2017/02/15/开源项目callHorizonMatlab/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Li Fan">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/mytestblog/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="vancky's Blog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="vancky's Blog" src="M27.jpg">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                开源项目callHorizonMatlab
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-02-15T22:20:27+08:00">
                Feb 15 2017
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="一个小的开源项目-callHorizonMatlab"><a href="#一个小的开源项目-callHorizonMatlab" class="headerlink" title="一个小的开源项目 callHorizonMatlab"></a>一个小的开源项目 <a href="https://github.com/vancky/callHorizonMatlab" target="_blank" rel="external">callHorizonMatlab</a></h2><p>通过matlab在线调用JPL的horizons历表，是根据 <a href="https://github.com/mommermi/callhorizons" target="_blank" rel="external">callhorizons</a> python版本演变过来的，但是做了一些简化。<br>主要提供了三个方法，可以分别获取历表，轨道根数，三维向量。</p>
<h2 id="基本用法"><a href="#基本用法" class="headerlink" title="基本用法"></a>基本用法</h2><h3 id="下载-queryHorizons-m-与queryTest-m-并加入matlab的路径。"><a href="#下载-queryHorizons-m-与queryTest-m-并加入matlab的路径。" class="headerlink" title="下载 queryHorizons.m 与queryTest.m 并加入matlab的路径。"></a>下载 queryHorizons.m 与queryTest.m 并加入matlab的路径。</h3><p>运行测试方法<br><figure class="highlight matlab"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">runtests(<span class="string">'queryTest'</span>);<span class="comment">% run the test</span></div></pre></td></tr></table></figure></p>
<h3 id="初始化离散时刻点，仅仅支持jd-或者mjd，不过你可以使用cspice-来进行时间转换。"><a href="#初始化离散时刻点，仅仅支持jd-或者mjd，不过你可以使用cspice-来进行时间转换。" class="headerlink" title="初始化离散时刻点，仅仅支持jd 或者mjd，不过你可以使用cspice 来进行时间转换。"></a>初始化离散时刻点，仅仅支持jd 或者mjd，不过你可以使用<a href="http://git.oschina.net/vancky/mice" target="_blank" rel="external">cspice</a> 来进行时间转换。</h3><figure class="highlight matlab"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">target=queryHorizons(<span class="string">'499'</span>);<span class="comment">% for Mars </span></div><div class="line">target=target.set_discreteepochs([<span class="number">2457446.177083</span>, <span class="number">2457446.182343</span>,<span class="number">2457448.182343</span>]);</div><div class="line">target=target.get_ephemerides(<span class="string">'O44'</span>);<span class="comment">% lijiang Station</span></div><div class="line"><span class="comment">% you can get elements like </span></div><div class="line">target=target.get_elements() <span class="comment">% sun centered</span></div><div class="line">target=target.get_elements(<span class="string">'SSB'</span>) <span class="comment">% SSB centered</span></div></pre></td></tr></table></figure>
<h3 id="初始化等间隔时间段，只支持格式’YYYY-MM-DD-HH-MM-SS-’"><a href="#初始化等间隔时间段，只支持格式’YYYY-MM-DD-HH-MM-SS-’" class="headerlink" title="初始化等间隔时间段，只支持格式’YYYY-MM-DD [HH-MM-SS]’"></a>初始化等间隔时间段，只支持格式’YYYY-MM-DD [HH-MM-SS]’</h3><figure class="highlight matlab"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">target=queryHorizons(<span class="string">'Ceres'</span>);</div><div class="line">target=target.set_epochrange(<span class="string">'2016-02-26'</span>, <span class="string">'2016-10-25'</span>, <span class="string">'1d'</span>)</div><div class="line">target=target.get_ephemerides(<span class="string">'O44'</span>);</div><div class="line">target=target.get_vectors();<span class="comment">% get vector in (J2000,  earth mean equator plane,SSB center)</span></div></pre></td></tr></table></figure>
<h3 id="获取数据也非常简单，返回的类有个属性originSrc，其内容就是JPL返回的文档，里面有最详细最权威的资料，对结果有疑问的时候可以参考。"><a href="#获取数据也非常简单，返回的类有个属性originSrc，其内容就是JPL返回的文档，里面有最详细最权威的资料，对结果有疑问的时候可以参考。" class="headerlink" title="获取数据也非常简单，返回的类有个属性originSrc，其内容就是JPL返回的文档，里面有最详细最权威的资料，对结果有疑问的时候可以参考。"></a>获取数据也非常简单，返回的类有个属性originSrc，其内容就是JPL返回的文档，里面有最详细最权威的资料，对结果有疑问的时候可以参考。</h3><figure class="highlight matlab"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">target.originSrc <span class="comment">% the origin source from Horizon </span></div><div class="line">target.data      <span class="comment">% the formated ephemrides from source , a matlab table format </span></div><div class="line">target.official_name <span class="comment">% check the name of object</span></div><div class="line">target.getitme(<span class="string">'RA'</span>,<span class="number">1</span>)  <span class="comment">% get the first RA</span></div><div class="line">target.data&#123;<span class="number">1</span>,<span class="string">'RA'</span>&#125; <span class="comment">% the same to the up </span></div><div class="line">target.getitme(<span class="string">'RA'</span>,:)  <span class="comment">% get all RA  </span></div><div class="line">target.fields <span class="comment">% show all items</span></div></pre></td></tr></table></figure>
<h2 id="注意"><a href="#注意" class="headerlink" title="注意"></a>注意</h2><ul>
<li>get_ephemerides 方法默认站点是O44(丽江观测站),这个可以在278行设置。默认参考系J2000.</li>
<li>get_elements 方法默认中心是太阳(10)，这个可以在444行设置。默认参考系J2000，默认参考平面为平黄道与J2000平春分点。</li>
<li>get_vectors 方法默认中心是太阳系质心(0,SSB),默认参考系J2000，默认参考平面为平赤道与平春分点。</li>
</ul>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/mytestblog/tags/matlab-horizons-ephemeris/" rel="tag"># matlab,horizons,ephemeris</a>
          
        </div>
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/mytestblog/2017/02/14/TEST/" rel="next" title="TEST">
                <i class="fa fa-chevron-left"></i> TEST
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/mytestblog/2017/02/23/NO1/" rel="prev" title="Numerical Optimization -Introduction">
                Numerical Optimization -Introduction <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>

          
          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/mytestblog/images/avatar.gif"
               alt="Li Fan" />
          <p class="site-author-name" itemprop="name">Li Fan</p>
          <p class="site-description motion-element" itemprop="description">About astronomy ,auto observatory ,asteroids ,ccd image process , machine learning!</p>
        </div>
        <nav class="site-state motion-element">
        
          
            <div class="site-state-item site-state-posts">
              <a href="/mytestblog/archives">
                <span class="site-state-item-count">5</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            <div class="site-state-item site-state-tags">
              <a href="/mytestblog/tags">
                <span class="site-state-item-count">2</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#一个小的开源项目-callHorizonMatlab"><span class="nav-number">1.</span> <span class="nav-text">一个小的开源项目 callHorizonMatlab</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#基本用法"><span class="nav-number">2.</span> <span class="nav-text">基本用法</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#下载-queryHorizons-m-与queryTest-m-并加入matlab的路径。"><span class="nav-number">2.1.</span> <span class="nav-text">下载 queryHorizons.m 与queryTest.m 并加入matlab的路径。</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#初始化离散时刻点，仅仅支持jd-或者mjd，不过你可以使用cspice-来进行时间转换。"><span class="nav-number">2.2.</span> <span class="nav-text">初始化离散时刻点，仅仅支持jd 或者mjd，不过你可以使用cspice 来进行时间转换。</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#初始化等间隔时间段，只支持格式’YYYY-MM-DD-HH-MM-SS-’"><span class="nav-number">2.3.</span> <span class="nav-text">初始化等间隔时间段，只支持格式’YYYY-MM-DD [HH-MM-SS]’</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#获取数据也非常简单，返回的类有个属性originSrc，其内容就是JPL返回的文档，里面有最详细最权威的资料，对结果有疑问的时候可以参考。"><span class="nav-number">2.4.</span> <span class="nav-text">获取数据也非常简单，返回的类有个属性originSrc，其内容就是JPL返回的文档，里面有最详细最权威的资料，对结果有疑问的时候可以参考。</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#注意"><span class="nav-number">3.</span> <span class="nav-text">注意</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Li Fan</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  




  
  <script type="text/javascript" src="/mytestblog/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/mytestblog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/mytestblog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/mytestblog/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/mytestblog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/mytestblog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/mytestblog/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/mytestblog/js/src/motion.js?v=5.1.0"></script>



  
  


  <script type="text/javascript" src="/mytestblog/js/src/affix.js?v=5.1.0"></script>

  <script type="text/javascript" src="/mytestblog/js/src/schemes/pisces.js?v=5.1.0"></script>



  
  <script type="text/javascript" src="/mytestblog/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/mytestblog/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/mytestblog/js/src/bootstrap.js?v=5.1.0"></script>



  



  




	





  





  





  



  
  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  

  


</body>
</html>
